
export const getTimeFormat = (date?: any)=>{
    date || (date = new Date());

    let month = date.getMonth() + 1;
    month = month > 9 ? month : `0${month}`;

    let day = date.getDate();
    day = day > 9 ? day : `0${day}`;

    let hours = date.getHours();
    hours = hours > 9 ? hours : `0${hours}`;

    let minutes = date.getMinutes();
    minutes = minutes > 9 ? minutes : `0${minutes}`;

    let seconds = date.getSeconds();
    seconds = seconds > 9 ? seconds : `0${seconds}`;

    return `${date.getFullYear()}-${month}-${day} ${hours}:${minutes}:${seconds}`;
};